package com.holdtime.jtt809.taxi.module.entity.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.holdtime.jtt809.taxi.module.entity.CarRegisterDO;
import com.holdtime.jtt809.taxi.module.model.vo.CarRegisterPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 车辆注册信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface CarRegisterMapper extends BaseMapperX<CarRegisterDO> {

    default PageResult<CarRegisterDO> selectPage(CarRegisterPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CarRegisterDO>()
                .eqIfPresent(CarRegisterDO::getPlatformId, reqVO.getPlatformId())
                .eqIfPresent(CarRegisterDO::getProducerId, reqVO.getProducerId())
                .eqIfPresent(CarRegisterDO::getTerminalModelType, reqVO.getTerminalModelType())
                .eqIfPresent(CarRegisterDO::getTerminalId, reqVO.getTerminalId())
                .eqIfPresent(CarRegisterDO::getSimCode, reqVO.getSimCode())
                .eqIfPresent(CarRegisterDO::getVehicleNo, reqVO.getVehicleNo())
                .eqIfPresent(CarRegisterDO::getVehicleColor, reqVO.getVehicleColor())
                .betweenIfPresent(CarRegisterDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CarRegisterDO::getId));
    }

}